import React from 'react'
import { ResultPage, Card , Button} from 'antd-mobile'
import { LoopOutline } from 'antd-mobile-icons'
import { useSelector, useDispatch } from "react-redux";
import style from './Css/home.module.css'
import { useNavigate } from 'react-router-dom';
function Index() {
    const nav=useNavigate()
    const start = useSelector((store) => store.counter.start);
    console.log(start);
    
    const end = useSelector((store) => store.counter.end);
    const date = useSelector((store) => store.counter.date);
    const isSpeed = useSelector((store) => store.counter.isSpeed);
    const dispatch = useDispatch();
    const tz=()=>{
        nav(`/cart?start=${start}&end=${end}&date=${date}&isSpeed=${isSpeed}`)
    }
  return (
    <div>
        <ResultPage
      status=''
      title=''
      description=''
    >
      <ResultPage.Card style={{  padding: 8 }}>
        <div className={style.row}>
            <span className={style.pp}>{start}</span>
            <LoopOutline className={style.pp} />
            <span className={style.pp}>{end}</span>
        </div>
        <div className={style.row}>
            <span>{date} (今天)</span>
        </div>
        <div className={style.row}>
        <Button block color='primary' size='middle' onClick={tz}>
        查询
        </Button>
           
        </div>
      </ResultPage.Card>

      <Card style={{ height: 128, marginTop: 12 }}>搭配 Card 使用</Card>
    </ResultPage>
    </div>
  )
}

export default Index
